import { PoolManager } from 'db://assets/Scripts/Framework/Managers/PoolManager';
import { InGameManager } from '../Managers/InGameManager';
import { Item } from './Item';

export class Adorn extends Item {

    type: number;
    rare: number;
    prefabUrl: string;

    static Init(_type: number, _num: number): Adorn {
        let data = InGameManager.itemsJson.Adorn[_type][_num];
        let adorn = PoolManager.GetItem(Adorn);
        adorn.type = _type;
        adorn.num = _num;
        adorn.itemName = data.name;
        adorn.rare = data.rare;
        adorn.sfUrl = data.spriteFrame;
        adorn.prefabUrl = data.prefab;
        return adorn;
    }

}